package com.kinggm.service.decorator.abs.impl;

import com.kinggm.service.decorator.abs.Beverage;
import com.kinggm.service.decorator.abs.CondimentDecorator;

public class Soy extends CondimentDecorator {

    Beverage berevage;

    public Soy(Beverage berevage) {
        this.berevage = berevage;
    }

    @Override
    public String getSize() {
        return berevage.getSize();
    }

    @Override
    public double cost() {
        switch (berevage.getSize()) {
            case "大杯":
                return 3 + berevage.cost();
            case "中杯":
                return 2.5 + berevage.cost();
            case "小杯":
                return 1.5 + berevage.cost();
            default:
                return 0;
        }
    }

    @Override
    public String getDescription() {
        return berevage.getDescription() + ",辣椒";
    }
}
